Skip to content

feat: Update strings and add new key#2372

Merged
UnschooledGamer merged 9 commits into
Acode-Foundation:mainfrom
claycuy:strings/update
Jun 24, 2026
Merged

feat: Update strings and add new key#2372
UnschooledGamer merged 9 commits into
Acode-Foundation:mainfrom
claycuy:strings/update

Conversation

@claycuy

@claycuy claycuy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Features

  • Update new strings
    • language package completion
    • settings-info-editor-language-completion
    • recommend extensions
    • settings-info-editor-recommend-extensions
    • extension recommendation title
    • extension recommendation message
    • extension request title
    • extension request message
    • search plugins
    • request plugin
  • Added Cursor Style Options:
    • terminal:block
    • terminal:underline
    • terminal:bar
  • Added Cursor Inactive Style Options:
    • terminal:inactive block
    • terminal:inactive underline
    • terminal:inactive bar
    • terminal:inactive none
  • Added Font Weight Options:
    • terminal:normal
    • terminal:bold
  • Added Quick Tools Options:
    • quicktools-trigger:click
    • quicktools-trigger:touch
  • Added settings-info-terminal-uninstall

note: For languages other than id-id.json I fallback to English

@github-actions github-actions Bot added the translations Anything related to Translations Whether a Issue or PR label Jun 24, 2026
@claycuy claycuy marked this pull request as ready for review June 24, 2026 04:18
@claycuy

claycuy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy claycuy changed the title feat: Update strings feat: Update strings and add new key Jun 24, 2026
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds localized display strings for terminal cursor style, inactive cursor style, font weight, and quicktools trigger mode dropdowns — replacing hardcoded English labels with strings["..."] lookups using [value, label] tuples so the correct xterm.js enum is always persisted. It also adds settings-info-terminal-uninstall as a localized confirmation message and backfills several previously untranslated Indonesian strings in id-id.json.

  • terminalSettings.js: All three affected select arrays (cursorStyle, cursorInactiveStyle, fontWeight) now use [value, label] tuples, correctly separating the stored xterm.js enum from the display string; the previously missing \"outline\" option is restored to cursorInactiveStyle.
  • appSettings.js: quickToolsTriggerMode select labels switched from hardcoded \"Click\"/\"Touch\" to strings[\"quicktools-trigger:click\"]/strings[\"quicktools-trigger:touch\"]; valueText still uses value.capitalize() and will show the English-capitalized stored key rather than the translated label for non-English users.
  • Language files (33 files): 13 new keys added across all locales; non-id-id files fall back to English values as noted in the PR description.

Confidence Score: 5/5

Safe to merge; the core fixes are correct and no functional regressions are introduced

The main corrections — using [value, label] tuples for all terminal select arrays and restoring the missing "outline" option — are correct and complete. The one open item is a cosmetic display inconsistency in the quicktools trigger mode setting for non-English users (valueText still shows the capitalized stored key rather than the translated label), but this does not affect stored values or runtime behavior.

src/settings/appSettings.js — the valueText function for quickToolsTriggerMode should be updated to return the localized label rather than the capitalized stored value

Important Files Changed

Filename Overview
src/settings/terminalSettings.js Fixed cursor style, cursor inactive style, and font weight selects to use [value, label] tuples so the stored value is always the xterm.js enum string; added back the missing "outline" option; replaced hard-coded uninstall confirmation string with the new localized key
src/settings/appSettings.js Updated quickToolsTriggerMode select to use localized strings via [value, label] tuples; valueText still uses value.capitalize() causing a display mismatch for non-English users
src/lang/index.d.ts Added all 13 new string keys (terminal cursor/inactive/font-weight/quicktools/uninstall) to the LangStrings type declaration
src/lang/id-id.json Fully translated new keys into Indonesian and backfilled previously English-only strings (recommend extensions, extension request/recommendation messages, search plugins, request plugin)
src/lang/en-us.json Added all 13 new string keys with correct English values as the canonical source for all other locales to fall back to

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Settings dropdown] --> B{Select array item}
    B --> C["[value, label] tuple\ne.g. ['block', strings['terminal:block']]"]
    C --> D[Stored value = xterm.js enum\ne.g. 'block']
    C --> E[Displayed label = localized string\ne.g. 'Blok' in Indonesian]
    D --> F[appSettings.update\nkey: cursorStyle / fontWeight / etc.]
    F --> G[updateActiveTerminals]
    G --> H[terminal.options.cursorStyle = 'block'\nxterm.js recognizes enum ✅]

    I[valueText for quickToolsTriggerMode] --> J["value.capitalize()\ne.g. 'click' → 'Click' (always English)"]
    J --> K[Settings list shows 'Click'\neven if locale label is 'Klik' ⚠️]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User opens Settings dropdown] --> B{Select array item}
    B --> C["[value, label] tuple\ne.g. ['block', strings['terminal:block']]"]
    C --> D[Stored value = xterm.js enum\ne.g. 'block']
    C --> E[Displayed label = localized string\ne.g. 'Blok' in Indonesian]
    D --> F[appSettings.update\nkey: cursorStyle / fontWeight / etc.]
    F --> G[updateActiveTerminals]
    G --> H[terminal.options.cursorStyle = 'block'\nxterm.js recognizes enum ✅]

    I[valueText for quickToolsTriggerMode] --> J["value.capitalize()\ne.g. 'click' → 'Click' (always English)"]
    J --> K[Settings list shows 'Click'\neven if locale label is 'Klik' ⚠️]
Loading

Reviews (4): Last reviewed commit: "fix: outline translations" | Re-trigger Greptile

Comment thread src/settings/terminalSettings.js
Comment thread src/settings/terminalSettings.js
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds new i18n string keys for terminal cursor style, font weight, quicktools trigger mode, and language completion settings, with full translations in id-id.json and English fallbacks in all other locales.

  • New string keys (terminal:block, terminal:underline, terminal:bar, the terminal:inactive * variants, terminal:normal, terminal:bold, quicktools-trigger:click/touch, and settings-info-terminal-uninstall) are wired into terminalSettings.js and appSettings.js for their respective settings UI items.
  • The cursorStyle, cursorInactiveStyle, and fontWeight selects in terminalSettings.js use bare translated strings (e.g. \"Block\", \"Normal\") as both display label and stored value instead of [xterm_value, label] tuples, meaning any selection the user makes stores a localized label that xterm.js cannot interpret.
  • index.d.ts was not regenerated after the new keys were added, so eleven of the thirteen new strings are absent from the TypeScript type declarations.

Confidence Score: 3/5

Not safe to merge as-is — changing cursor style or font weight in terminal settings will silently persist an unrecognized value, leaving the terminal cursor appearance stuck regardless of what the user selects.

The cursor style, inactive cursor style, and font weight settings now store localized display strings (e.g. "Block", "Normal") directly into app settings instead of the lowercase xterm.js enum values those fields require. Any user who touches those options in the UI will end up with a broken setting that xterm.js ignores. The fix is straightforward — wrap each option in a [value, label] tuple — but until that is done the terminal settings panel actively mis-configures the terminal for users who interact with it.

src/settings/terminalSettings.js needs the cursorStyle, cursorInactiveStyle, and fontWeight selects reworked to use [value, label] tuples. src/lang/index.d.ts needs to be regenerated with pnpm lang createTypes to pick up the new string keys.

Important Files Changed

Filename Overview
src/settings/terminalSettings.js Adds new string keys for cursor style, font weight, and quicktools options; however the cursorStyle, cursorInactiveStyle, and fontWeight selects store localized display labels instead of the lowercase xterm.js enum values, silently breaking those settings when changed by the user.
src/lang/index.d.ts Two new string keys (language package completion, settings-info-editor-language-completion) were correctly added, but the eleven new terminal/quicktools keys are missing — the auto-generated type declarations were not regenerated after this PR's JSON additions.
src/lang/en-us.json Correctly adds all 13 new string keys with accurate English values; serves as the authoritative reference that other locales fall back to.
src/lang/id-id.json Fully translated version of all new keys in Indonesian; the only non-English locale with proper translations rather than English fallbacks.
src/settings/appSettings.js Correctly wires quicktools trigger mode with [value, label] tuples using the new string keys — the pattern that terminalSettings.js should also follow for cursor style options.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Terminal Settings] --> B[Selects cursor style option]
    B --> C{Select format}
    C -->|Current: bare string| D["Stores localized text\ne.g. 'Block' / 'Blok'"]
    C -->|Expected: value+label tuple| E["Stores xterm.js enum\ne.g. 'block'"]
    D --> F[appSettings.update cursorStyle = 'Block']
    E --> G[appSettings.update cursorStyle = 'block']
    F --> H[updateActiveTerminals]
    G --> H
    H --> I[terminal.options.cursorStyle = value]
    I -->|'Block' not recognized| J["❌ xterm.js ignores value\nCursor unchanged"]
    I -->|'block' valid| K["✅ Cursor style applied"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User opens Terminal Settings] --> B[Selects cursor style option]
    B --> C{Select format}
    C -->|Current: bare string| D["Stores localized text\ne.g. 'Block' / 'Blok'"]
    C -->|Expected: value+label tuple| E["Stores xterm.js enum\ne.g. 'block'"]
    D --> F[appSettings.update cursorStyle = 'Block']
    E --> G[appSettings.update cursorStyle = 'block']
    F --> H[updateActiveTerminals]
    G --> H
    H --> I[terminal.options.cursorStyle = value]
    I -->|'Block' not recognized| J["❌ xterm.js ignores value\nCursor unchanged"]
    I -->|'block' valid| K["✅ Cursor style applied"]
Loading

Comments Outside Diff (1)

  1. src/settings/terminalSettings.js, line 72-90 (link)

    P1 fontWeight select stores localized text instead of xterm.js font-weight values

    strings["terminal:normal"] and strings["terminal:bold"] resolve to capitalized labels ("Normal", "Bold") that are stored directly as the setting value. xterm.js fontWeight accepts "normal" and "bold" (lowercase) in addition to numeric strings. Selecting either option overwrites the setting with a value xterm.js won't recognize, reverting the terminal to its internal default rather than the user's choice. These two entries need [value, label] pairs: ["normal", strings["terminal:normal"]] and ["bold", strings["terminal:bold"]].

Reviews (2): Last reviewed commit: "format" | Re-trigger Greptile

Comment thread src/settings/terminalSettings.js
Comment thread src/lang/index.d.ts Outdated
@claycuy

claycuy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy

claycuy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@greptile I have fixed the font weight

@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

The fix looks great. All three original issues are now resolved:

  • fontWeight correctly uses ["normal", strings["terminal:normal"]] and ["bold", strings["terminal:bold"]] tuples for the translated values, while numeric weights ("100" through "900") stay as plain strings — that's the right approach since those don't need translation.
  • cursorStyle and cursorInactiveStyle both use [value, label] tuples so the xterm.js enum value is stored, not the display text.
  • "outline" is back in cursorInactiveStyle with the "terminal:inactive outline" key properly defined in en-us.json.

Everything looks correct now.

@claycuy

claycuy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy

claycuy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Ready to be reviewed if this PR is useful

@UnschooledGamer UnschooledGamer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@UnschooledGamer UnschooledGamer merged commit 3420c70 into Acode-Foundation:main Jun 24, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jun 24, 2026
@UnschooledGamer UnschooledGamer moved this from Done to 🫡 Done by Community in The Code Board - Acode Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community translations Anything related to Translations Whether a Issue or PR

Projects

Status: 🫡 Done by Community

Development

Successfully merging this pull request may close these issues.

2 participants